<!DOCTYPE html>
<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>错误 - AI面试助手</title>
    <!-- Bootstrap CSS -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet"
          integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
    <!-- Bootstrap Icons -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css" rel="stylesheet">
    <style>
        /* CSS变量定义 */
        :root {
            --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            --secondary-gradient: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
            --error-color: #dc3545;
            --primary-color: #667eea;
            --secondary-color: #764ba2;
            --text-color: #333;
            --text-muted: #6c757d;
            --white: #ffffff;
            --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.05);
            --shadow-md: 0 10px 20px rgba(0, 0, 0, 0.05);
            --shadow-lg: 0 15px 30px rgba(0, 0, 0, 0.1);
            --border-radius: 15px;
        }
        
        /* 基础样式 */
        body {
            background: var(--secondary-gradient);
            text-align: center;
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0;
            padding: 20px;
        }
        
        /* 错误容器 */
        .error-container {
            max-width: 600px;
            width: 100%;
            background-color: var(--white);
            padding: 60px 40px;
            border-radius: var(--border-radius);
            box-shadow: var(--shadow-lg);
            transition: all 0.3s ease;
            position: relative;
            overflow: hidden;
            transform-style: preserve-3d;
        }
        
        .error-container::before {
            content: '';
            position: absolute;
            top: -100%;
            left: -100%;
            width: 300%;
            height: 300%;
            background: linear-gradient(45deg, transparent 0%, rgba(102, 126, 234, 0.05) 50%, transparent 100%);
            transform: rotate(45deg);
            animation: scan 8s infinite;
        }
        
        @keyframes scan {
            0% {
                transform: rotate(45deg) translateY(-100%);
            }
            100% {
                transform: rotate(45deg) translateY(100%);
            }
        }
        
        .error-container:hover {
            box-shadow: 0 20px 40px rgba(0,0,0,0.15);
            transform: translateY(-5px) scale(1.01);
        }
        
        /* 错误图标 */
        .error-icon {
            font-size: 6rem;
            color: var(--error-color);
            margin-bottom: 25px;
            animation: pulse 2s infinite;
            position: relative;
            display: inline-block;
        }
        
        .error-icon::after {
            content: '';
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: 120%;
            height: 120%;
            border-radius: 50%;
            background: radial-gradient(circle, rgba(220,53,69,0.1) 0%, transparent 70%);
            animation: glow 2s infinite;
        }
        
        @keyframes pulse {
            0% {
                transform: scale(1);
            }
            50% {
                transform: scale(1.05);
            }
            100% {
                transform: scale(1);
            }
        }
        
        @keyframes glow {
            0% {
                transform: translate(-50%, -50%) scale(1);
                opacity: 0.7;
            }
            50% {
                transform: translate(-50%, -50%) scale(1.1);
                opacity: 0.4;
            }
            100% {
                transform: translate(-50%, -50%) scale(1);
                opacity: 0.7;
            }
        }
        
        /* 错误标题 */
        .error-title {
            color: var(--error-color);
            margin-bottom: 20px;
            font-weight: 700;
            position: relative;
            display: inline-block;
        }
        
        .error-title::after {
            content: '';
            position: absolute;
            bottom: -5px;
            left: 50%;
            transform: translateX(-50%);
            width: 0;
            height: 3px;
            background-color: var(--error-color);
            transition: width 0.3s ease;
        }
        
        .error-container:hover .error-title::after {
            width: 100%;
        }
        
        /* 错误消息 */
        .error-message {
            margin-bottom: 30px;
            color: var(--text-muted);
            font-size: 1.1rem;
            line-height: 1.6;
            padding: 0 10px;
        }
        
        /* 返回按钮 */
        .btn-back {
            background: var(--primary-gradient);
            color: var(--white);
            padding: 12px 28px;
            border-radius: 8px;
            text-decoration: none;
            font-weight: 600;
            border: none;
            transition: all 0.3s ease;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 1rem;
            position: relative;
            overflow: hidden;
            z-index: 1;
            min-width: 150px;
        }
        
        .btn-back::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
            transition: all 0.5s ease;
            z-index: -1;
        }
        
        .btn-back:hover {
            transform: translateY(-3px);
            box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
            color: var(--white);
        }
        
        .btn-back:hover::before {
            left: 100%;
        }
        
        .btn-back i {
            margin-right: 8px;
            transition: transform 0.3s ease;
        }
        
        .btn-back:hover i {
            transform: translateX(-3px);
        }
        
        /* 额外的统计信息区域 */
        .error-stats {
            margin-top: 30px;
            padding-top: 20px;
            border-top: 1px solid #e9ecef;
            font-size: 0.9rem;
            color: var(--text-muted);
        }
        
        /* 淡入动画 */
        .fade-in {
            animation: fadeIn 0.8s ease-in-out;
            opacity: 0;
            animation-fill-mode: forwards;
        }
        
        @keyframes fadeIn {
            from {
                opacity: 0;
                transform: translateY(20px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }
        
        /* 响应式优化 */
        @media (max-width: 768px) {
            .error-container {
                padding: 40px 20px;
            }
            
            .error-icon {
                font-size: 5rem;
            }
            
            .error-title {
                font-size: 1.8rem;
            }
        }
        
        @media (max-width: 576px) {
            .error-container {
                padding: 30px 15px;
            }
            
            .error-icon {
                font-size: 4rem;
            }
            
            .btn-back {
                padding: 10px 20px;
                width: 100%;
            }
        }
    </style>
</head>
<body>
    <div class="container">
            <div class="error-container fade-in">
                <div class="error-icon" style="animation-delay: 0.2s;">
                    <i class="bi bi-exclamation-circle"></i>
                </div>
                <h1 class="error-title fade-in" style="animation-delay: 0.4s;">哎呀，出错了</h1>
                <p class="error-message fade-in" style="animation-delay: 0.6s;" th:text="${errorMessage}">抱歉，服务器遇到了一个错误，请稍后再试。</p>
                <a href="/home" class="btn-back fade-in" style="animation-delay: 0.8s;">
                    <i class="bi bi-arrow-left"></i> 返回首页
                </a>
                <div class="error-stats fade-in" style="animation-delay: 1s;">
                    <p>错误代码: <span th:text="${status}" class="text-primary">500</span> | 时间: <span th:text="${timestamp}" th:remove="tag">2024-01-01 12:00:00</span></p>
                </div>
            </div>
        </div>

    <!-- Bootstrap Bundle with Popper -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"
            integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL"
            crossorigin="anonymous"></script>
    
    <!-- 自定义脚本 -->
    <script>
        document.addEventListener('DOMContentLoaded', function() {
            // 按钮悬停效果增强
            const backButton = document.querySelector('.btn-back');
            
            backButton.addEventListener('mouseenter', function() {
                this.style.transform = 'translateY(-3px) scale(1.03)';
            });
            
            backButton.addEventListener('mouseleave', function() {
                this.style.transform = 'translateY(0) scale(1)';
            });
            
            // 添加错误图标随机轻微摆动效果
            const errorIcon = document.querySelector('.error-icon');
            
            function randomWiggle() {
                const randomX = (Math.random() * 10 - 5);
                const randomY = (Math.random() * 10 - 5);
                const randomRotation = (Math.random() * 6 - 3);
                
                errorIcon.style.transform = `translate(${randomX}px, ${randomY}px) rotate(${randomRotation}deg)`;
                
                setTimeout(() => {
                    errorIcon.style.transform = 'translate(0, 0) rotate(0deg)';
                    setTimeout(randomWiggle, 2000);
                }, 500);
            }
            
            // 启动随机摆动效果
            setTimeout(randomWiggle, 3000);
            
            // 添加页面加载动画效果
            const elements = document.querySelectorAll('.fade-in');
            elements.forEach(element => {
                element.style.animationPlayState = 'running';
            });
            
            // 添加页面点击特效
            document.addEventListener('click', function(e) {
                if (!backButton.contains(e.target)) {
                    createRipple(e);
                }
            });
            
            function createRipple(e) {
                const ripple = document.createElement('div');
                ripple.classList.add('ripple-effect');
                ripple.style.position = 'fixed';
                ripple.style.width = '100px';
                ripple.style.height = '100px';
                ripple.style.borderRadius = '50%';
                ripple.style.backgroundColor = 'rgba(102, 126, 234, 0.1)';
                ripple.style.transform = 'translate(-50%, -50%) scale(0)';
                ripple.style.left = e.clientX + 'px';
                ripple.style.top = e.clientY + 'px';
                ripple.style.zIndex = '9999';
                ripple.style.pointerEvents = 'none';
                ripple.style.animation = 'ripple 0.8s ease-out forwards';
                document.body.appendChild(ripple);
                
                setTimeout(() => {
                    ripple.remove();
                }, 800);
            }
            
            @keyframes ripple {
                to {
                    transform: translate(-50%, -50%) scale(5);
                    opacity: 0;
                }
            }
        });
    </script>
</body>
</html>